{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/latex": [
       "\\begin{verbatim}\n",
       "filter(function, collection)\n",
       "\\end{verbatim}\n",
       "Return a copy of \\texttt{collection}, removing elements for which \\texttt{function} is \\texttt{false}. For associative collections, the function is passed two arguments (key and value).\n"
      ],
      "text/markdown": [
       "```\n",
       "filter(function, collection)\n",
       "```\n",
       "\n",
       "Return a copy of `collection`, removing elements for which `function` is `false`. For associative collections, the function is passed two arguments (key and value).\n"
      ],
      "text/plain": [
       "```\n",
       "filter(function, collection)\n",
       "```\n",
       "\n",
       "Return a copy of `collection`, removing elements for which `function` is `false`. For associative collections, the function is passed two arguments (key and value).\n"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "@doc filter"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "using HTTPClient.HTTPC"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/latex": [
       "No documentation found.\n",
       "\\texttt{HTTPClient.HTTPC.post} is a generic \\texttt{Function}.\n",
       "\\begin{verbatim}\n",
       "# 3 methods for generic function \"post\":\n",
       "post(url::AbstractString, data::AbstractString) at /Users/utensil/.julia/v0.4/HTTPClient/src/HTTPC.jl:542\n",
       "post(url::AbstractString, data) at /Users/utensil/.julia/v0.4/HTTPClient/src/HTTPC.jl:402\n",
       "post(url::AbstractString, data, options::HTTPClient.HTTPC.RequestOptions) at /Users/utensil/.julia/v0.4/HTTPClient/src/HTTPC.jl:402\n",
       "\\end{verbatim}\n"
      ],
      "text/markdown": [
       "No documentation found.\n",
       "\n",
       "`HTTPClient.HTTPC.post` is a generic `Function`.\n",
       "\n",
       "```julia\n",
       "# 3 methods for generic function \"post\":\n",
       "post(url::AbstractString, data::AbstractString) at /Users/utensil/.julia/v0.4/HTTPClient/src/HTTPC.jl:542\n",
       "post(url::AbstractString, data) at /Users/utensil/.julia/v0.4/HTTPClient/src/HTTPC.jl:402\n",
       "post(url::AbstractString, data, options::HTTPClient.HTTPC.RequestOptions) at /Users/utensil/.julia/v0.4/HTTPClient/src/HTTPC.jl:402\n",
       "```\n"
      ],
      "text/plain": [
       "No documentation found.\n",
       "\n",
       "`HTTPClient.HTTPC.post` is a generic `Function`.\n",
       "\n",
       "```julia\n",
       "# 3 methods for generic function \"post\":\n",
       "post(url::AbstractString, data::AbstractString) at /Users/utensil/.julia/v0.4/HTTPClient/src/HTTPC.jl:542\n",
       "post(url::AbstractString, data) at /Users/utensil/.julia/v0.4/HTTPClient/src/HTTPC.jl:402\n",
       "post(url::AbstractString, data, options::HTTPClient.HTTPC.RequestOptions) at /Users/utensil/.julia/v0.4/HTTPClient/src/HTTPC.jl:402\n",
       "```\n"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "@doc post"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"/opt/homebrew-cask/Caskroom/julia/0.4.5/Julia-0.4.5.app/Contents/Resources/julia/share/doc/julia\""
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "julia_doc_home = abspath(joinpath(JULIA_HOME, \"../share/doc/julia\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "cd(julia_doc_home)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "run(`open html/index.html`)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "14-element Array{ByteString,1}:\n",
       " \"bubblesort.jl\" \n",
       " \"dictchannel.jl\"\n",
       " \"hpl.jl\"        \n",
       " \"juliatypes.jl\" \n",
       " \"lru.jl\"        \n",
       " \"lru_test.jl\"   \n",
       " \"modint.jl\"     \n",
       " \"ndgrid.jl\"     \n",
       " \"queens.jl\"     \n",
       " \"quine.jl\"      \n",
       " \"staged.jl\"     \n",
       " \"time.jl\"       \n",
       " \"typetree.jl\"   \n",
       " \"wordcount.jl\"  "
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "examples = filter(r\"\\.jl$\", readdir(joinpath(julia_doc_home, \"examples\")))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Running bubblesort.jl\n",
      "\n",
      "Running dictchannel.jl\n",
      "\n",
      "Running hpl.jl\n",
      "\n",
      "Running juliatypes.jl\n",
      "\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      "WARNING: deprecated syntax \"size (\" at /opt/homebrew-cask/Caskroom/julia/0.4.5/Julia-0.4.5.app/Contents/Resources/julia/share/doc/julia/examples/hpl.jl:56.\n",
      "Use \"size(\" instead.\n",
      "\n",
      "WARNING: deprecated syntax \"size (\" at /opt/homebrew-cask/Caskroom/julia/0.4.5/Julia-0.4.5.app/Contents/Resources/julia/share/doc/julia/examples/hpl.jl:77.\n",
      "Use \"size(\" instead.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Running lru.jl\n",
      "\n",
      "Running lru_test.jl\n",
      "\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING: redefining constant AnyT\n",
      "WARNING: redefining constant TupleName\n",
      "WARNING: redefining constant TupleT\n",
      "WARNING: redefining constant tndict\n",
      "WARNING: redefining constant menagerie\n",
      "WARNING: replacing module LRUExample\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Running modint.jl\n",
      "\n",
      "Running ndgrid.jl\n",
      "\n",
      "Running queens.jl\n",
      "\n",
      "Running quine.jl\n",
      "\n",
      "x=\"println(\\\"x=\\$(repr(x))\\\\n\\$x\\\")\"\n",
      "println(\"x=$(repr(x))\\n$x\")\n",
      "Running staged.jl\n",
      "\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING: replacing module ModInts\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Running time.jl\n",
      "\n",
      "Running typetree.jl\n",
      "\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING: replacing module Time\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Running wordcount.jl\n",
      "\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING: replacing module TypeTrees\n"
     ]
    }
   ],
   "source": [
    "for example_file in examples\n",
    "    full_path = joinpath(julia_doc_home, \"examples\", example_file)\n",
    "    # println(readall(open(full_path)))\n",
    "    println(\"Running $example_file\\n\")\n",
    "    \n",
    "    include(full_path)\n",
    "end"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Julia 0.4.5",
   "language": "julia",
   "name": "julia-0.4"
  },
  "language_info": {
   "file_extension": ".jl",
   "mimetype": "application/julia",
   "name": "julia",
   "version": "0.4.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
